import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./plugins/element.js";
//全局css
import "./assets/css/global.css";
//iconfont
import "./assets/font/iconfont.css";
//导入nprogress
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

//axios
import axios from "axios";
//配置根路径
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
//挂载token
axios.interceptors.request.use(config => {
  NProgress.start();
  // 在发送请求之前做些什么
  config.headers.Authorization = window.sessionStorage.getItem('token');
  return config;
})
axios.interceptors.response.use(config => {
  NProgress.done();
  return config
})
//吧axios挂载打vue的原型对象上
Vue.prototype.$http = axios

//vue-table
import ZkTable from 'vue-table-with-tree-grid'
Vue.component('tree-table', ZkTable)

//富文本
import VueQuillEditor from 'vue-quill-editor'

import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme

Vue.use(VueQuillEditor)


Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");